package com.mallcai.bigdata.ladon.dpl.vo;

import org.apache.commons.lang3.StringUtils;

/**
 * @author gst
 * @date 2019-12-30 20:36
 */
public enum CommonInfoType {
    /**
     * 呆萝卜部门信息
     */
    DEPARTMENT_INFO("department", "部门", null);

    private String code;
    private String desc;
    private String parentCode;

    CommonInfoType(String code, String desc, String parentCode) {
        this.code = code;
        this.desc = desc;
        this.parentCode = parentCode;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getParentCode() {
        return parentCode;
    }

    public static CommonInfoType getByCode(String code) {
        for (CommonInfoType cit : values()) {
            if (StringUtils.equals(code, cit.getCode())) {
                return cit;
            }
        }
        return null;
    }
}
